package com.bm.server.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bm.server.entity.Dogkill;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;



/**
 * .=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.
 * |                     ______                     |
 * |                  .-"      "-.                  |
 * |                 /            \                 |
 * |     _          |              |          _     |
 * |    ( \         |,  .-.  .-.  ,|         / )    |
 * |     > "=._     | )(__/  \__)( |     _.=" <     |
 * |    (_/"=._"=._ |/     /\     \| _.="_.="\_)    |
 * |           "=._"(_     ^^     _)"_.="           |
 * |               "=\__|IIIIII|__/="               |
 * |              _.="| \IIIIII/ |"=._              |
 * |    _     _.="_.="\          /"=._"=._     _    |
 * |   ( \_.="_.="     `--------`     "=._"=._/ )   |
 * |    > _.="                            "=._ <    |
 * |   (_/                                    \_)   |
 * |                                                |
 * '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-='
 * -----------------代码的搬运工-----------------
 *
 * @Date: 2022/07/21/11:54
 */
public interface DogkillDao extends BaseMapper<Dogkill> {
    @Select("SELECT count(uid) as uidnums FROM t_dogkill WHERE roomid=#{roomid}")
    int count(int roomid);
    //分配身份
    @Update("update t_dogkill set name=#{name},flag=1 where uid=#{uid}")
    int update(int uid,String name);
    //修改状态，用户濒临死亡。
    @Update("update t_dogkill set flag=0 where uid=#{uid}")
    int updateflag(int uid);
    //修改状态，用户存活。
    @Update("update t_dogkill set flag=1 where uid=#{uid}")
    int updateflagsave(int uid);
    //修改状态，用户死亡
    @Update("update t_dogkill set flag=2 where uid=#{uid}")
    int updateflagdead(int uid);
    //女巫角色初始化
    @Update("update t_dogkill set jieyao=1,duyao=1 where roomid=#{roomid}")
    int updatenvwu(int roomid);
    @Update("update t_dogkill set jieyao=0 where uid=#{uid}")
    int updatejieyao(int uid);
    @Update("update t_dogkill set duyao=0 where uid=#{uid}")
    int updateduyao(int uid);
    //投票
    @Update("UPDATE t_dogkill SET nums=(nums+1) where roomid=#{roomid} and uid=#{uid}")
    int updateNums(int roomid,int uid);
}
